package cc.rengu.redp.bizimpl.upmp.dao;

import cc.rengu.redp.bizimpl.upmp.domain.BProdInfo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 刘玉亮.LL
 * @since 2021-06-10
 */
public interface BProdInfoMapper extends BaseMapper<BProdInfo> {
    @Select("select Max(PROD_CODE)+1 from T_B_PROD_INFO where INST_ID=#{instId} and PROD_STATUS != 'M'")
    public Integer getMaxProdCode(String instId);

    IPage<BProdInfo> findAddProdInfoSubByPage(Page<BProdInfo> page, @Param("ew") Wrapper<BProdInfo> queryWrapper, @Param("bProdInfo") BProdInfo bProdInfo);
    IPage<BProdInfo> findUpdProdInfoSubByPage(Page<BProdInfo> page, @Param("ew") Wrapper<BProdInfo> queryWrapper, @Param("bProdInfo") BProdInfo bProdInfo);
    IPage<BProdInfo> findChckProdInfoSubByPage(Page<BProdInfo> page, @Param("ew") Wrapper<BProdInfo> queryWrapper, @Param("bProdInfo") BProdInfo bProdInfo);
    IPage<BProdInfo> findByPage(Page<BProdInfo> page, @Param("ew") Wrapper<BProdInfo> queryWrapper, @Param("bProdInfo") BProdInfo bProdInfo);

    void updateProdInfo(BProdInfo entity);
}
